package beans;

//~--- non-JDK imports --------------------------------------------------------

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;

//~--- JDK imports ------------------------------------------------------------

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionMessage;

/**
 * @author Sci.Maha
 *
 */
public class RegisterationFormBean extends org.apache.struts.action.ActionForm {
    FormFile theFile;
    String   userName, password, fname, lname, radio, country, mail,confirmpassword;

    public RegisterationFormBean() {
        System.out.println("It's Registeration Form Bean");
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getFname() {
        return fname;
    }

    public void setFname(String fname) {
        this.fname = fname;
    }

    public String getLname() {
        return lname;
    }

    public void setLname(String lname) {
        this.lname = lname;
    }

    public String getRadio() {
        return radio;
    }

    public void setRadio(String radio) {
        this.radio = radio;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
        System.out.println(country);
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

       public FormFile getTheFile() {
		System.out.println("jjjjjjjjjjjjjjjjjjjjjjjjjjjj");
		return theFile;
	}

	public void setTheFile(FormFile theFile) {
		System.out.println("cocooooooooooooooooooo");
		this.theFile = theFile;
	}

    public String getConfirmpassword() {
        return confirmpassword;
    }

    public void setConfirmpassword(String confirmpassword) {
        this.confirmpassword = confirmpassword;
        System.out.println(confirmpassword+"Confirmed");
    }
        
        
    @Override
    public void reset(ActionMapping actionMapping, HttpServletRequest request) {
        System.out.println("I am in");
    }

    @Override
    public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest request) {
//        ActionErrors errors = new ActionErrors();
//         if ((userName == null) || userName.equals(""))
//         {
//            errors.add("EmptyUserName", new ActionMessage("EmptyUserName"));
//         }
//         if ((password == null) || password.equals(""))
//         {
//            errors.add("EmptyUserPassword", new ActionMessage("EmptyUserPassword"));
//         }
//         if ((fname == null) || fname.equals(""))
//         {
//            errors.add("EmptyFirstName", new ActionMessage("EmptyFName"));
//         }
//         if ((lname == null) || lname.equals(""))
//         {
//            errors.add("EmptyLastName", new ActionMessage("EmptyLName"));
//         }
//         if ((country == null) || country.equals("")|| !country.equals("0"))
//         {
//            errors.add("EmptyCountry", new ActionMessage("EmptyCountry"));
//         }
//         if ((radio == null) || radio.equals(""))
//         {
//            errors.add("EmptyGender", new ActionMessage("EmptyGender"));
//         }
//         if ((mail == null) || mail.equals(""))
//         {  
//            errors.add("EmptyMail", new ActionMessage("EmptyEmail"));
//         }
//         
//         if(!mail.contains("@"))
//         {
//            errors.add("At", new ActionMessage("EmptyAt"));   
//         }
//  
//         if ((theFile == null) || theFile.equals(""))
//         {
//            errors.add("EmptyAvatar", new ActionMessage("EmptyAvatar"));
//         }
//        return errors;
        return null;
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
